//
//  myapp-Prefix.h
//  myapp
//
//  Created by 安建伟 on 2019/7/22.
//  Copyright © 2019 Facebook. All rights reserved.
//

#ifndef myapp_Prefix_h
#define myapp_Prefix_h

#ifdef __OBJC__
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#import <SVProgressHUD/SVProgressHUD.h>
#import "TouchTableView.h"
#import "NSObject+Common.h"
#import "NSString+Common.h"
#import "UIColor+ColorChange.h"
#import "UIButton+Common.h"
#import "UIViewController+Common.h"
#import <Masonry/Masonry.h>
#import <MJRefresh/MJRefresh.h>
#import "RDVTabBarController.h"
#import "YAlertViewController.h"
#import "NSDate+Common.h"
#import <GizWifiSDK/GizWifiSDK.h>
#import "GizManage.h"
#import "OpenNativeModule.h"
#import "ReactRootViewManager.h"
#import "NSString+HexToBytes.h"
#import "GosTipView.h"

#endif
// Include any system framework and library headers here that should be included in all compilation units.
// You will also need to set the Prefix Header build setting of one or more of your targets to reference this file.
#define yKeyWindow [UIApplication sharedApplication].keyWindow

#define ScreenWidth                         [[UIScreen mainScreen] bounds].size.width
#define ScreenHeight                        [[UIScreen mainScreen] bounds].size.height

#define IS_IPHONE (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
#define IS_PAD (UI_USER_INTERFACE_IDIOM()== UIUserInterfaceIdiomPad)

#define UI_IS_IPHONE5           (IS_IPHONE && [[UIScreen mainScreen] bounds].size.height == 568.0)
#define UI_IS_IPHONE6           (IS_IPHONE && [[UIScreen mainScreen] bounds].size.height == 667.0)
#define UI_IS_IPHONE6PLUS       (IS_IPHONE && [[UIScreen mainScreen] bounds].size.height == 736.0 || [[UIScreen mainScreen] bounds].size.width == 736.0)
#define yDevice_Is_iPhoneX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) && !IS_PAD : NO)
#define yDevice_Is_iPhoneXS_MAX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1242, 2688), [[UIScreen mainScreen] currentMode].size) && !IS_PAD : NO)
#define yDevice_Is_iPhoneXR ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(828, 1792), [[UIScreen mainScreen] currentMode].size) && !IS_PAD : NO)

#define getRectNavAndStatusHight (self.navigationController.navigationBar.frame.size.height+[[UIApplication sharedApplication] statusBarFrame].size.height)
#define tabbarHeight 50.f
#define ySafeArea_Bottom ((yDevice_Is_iPhoneX | yDevice_Is_iPhoneXS_MAX | yDevice_Is_iPhoneXR)? 34: 0)

#define yAutoFit(x) (ScreenWidth < ScreenHeight ? ScreenWidth / 375.f * x : ScreenHeight / 375.f * x)

#define viewWidth self.contentView.frame.size.width
#define viewHeight self.contentView.frame.size.height

#define yHttpTimeoutInterval 6.f

#define LocalString(x)      NSLocalizedString(x, nil)

#define GizAppId @"5b5e4344664a4ad7bc12694bd6352063"
#define GizAppSecret @"e3f207a661a647c5a0af3cb465836024"
#define GizAppproductKey @"9bf8701a49eb438992ad23fdfca3f2a7"
#define GizAppproductSecret @"de6d7e077f1f462eb64e5f8941491db6"

typedef enum : NSUInteger {
  yUnselect = 1000,
  ySelect,
  yUp,
  yDown,
} selectionStatus;

#endif /* myapp_Prefix_h */
